//
//  DRButton.h
//  JXFMerchant
//
//  Created by cqdingwei@163.com on 17/2/10.
//  Copyright © 2017年 dingwei. All rights reserved.
//

#import <UIKit/UIKit.h>

typedef NS_OPTIONS(NSInteger, DRButtonSubviewLayoutStyle) {
    /**
     水平布局,和原生UIButton一样,图片在前,标题在后
     */
    DRButtonSubviewLayoutStyleHorizontal    =   0,//default
    /**
     水平反向布局,标题在前,图片在后
     */
    DRButtonSubviewLayoutStyleHorizontalReverse,
    /**
     垂直布局,图片在上,标题在下
     */
    DRButtonSubviewLayoutStyleVertical,
    
    /**
     垂直反向布局,标题在上,图片中在下
     */
    DRButtonSubviewLayoutStyleVerticalReverse,
    
    /**
     自定义
     */
    DRButtonSubviewLayoutStyleCustom,
};

typedef NS_ENUM(NSInteger,DRButtonContentAlignment) {
    DRButtonContentAlignmentLeft,
    DRButtonContentAlignmentRight,
    DRButtonContentAlignmentCenter = 0
}NS_UNAVAILABLE;




@interface DRButton : UIButton
{
    CGSize titleSize;
}
/**
 按钮内部imageView和titleLabel的布局样式
 */
@property (nonatomic,assign) DRButtonSubviewLayoutStyle subviewLayoutStyle;
/**
 imageView和titleLabel间距
 */
@property (nonatomic, assign) CGFloat imageTitleMargin;
/**
 imageView 和titleLabel 整体布局方向
 */
@property (nonatomic, assign) DRButtonContentAlignment contentAlignment NS_UNAVAILABLE;

/**
 如果自定义需要设置这两个值
 */
@property (nonatomic) CGRect titleRect;

@property (nonatomic) CGRect imageRect;




/**
 便利初始化,可选择其他初始化方式
 */
- (instancetype)initWithStyle:(DRButtonSubviewLayoutStyle)style;

@end
